package com.example.gbuffer.Component.Camera;
import android.opengl.Matrix;

public class PerspectiveCamera extends Camera{
    public PerspectiveCamera(){};
    PerspectiveCamera(float fovy, float aspect, float zNear, float zFar){
        m_fovy = fovy;
        m_aspect = aspect;
        m_zNear = zNear;
        m_zFar = zFar;
    }

    private float m_fovy = 65.0f;
    private float m_aspect = 1920.0f / 1080.0f;
    private float m_zNear = 0.1f;
    private float m_zFar = 100.0f;

    public void setFovy(float fovy){m_fovy = fovy;}
    public void setAspect(float aspect){m_aspect = aspect;}
    public void setZNear(float zNear){m_zNear = zNear;}
    public void setZFar(float zFar){m_zFar = zFar;}

    public float[] project(){
        float[] mat = new float[16];
        Matrix.perspectiveM(mat, 0,
                m_fovy, m_aspect,
                m_zNear, m_zFar);

        return mat;
    }

}
